package zasm.zasm.assembler;

public abstract class AbstractEvaluator implements Evaluator {

	@Override
	public int evaluateSigned(final String expression, final int size) {
		return evaluate(expression, -(0x100 << (size - 1)), (0x100 << (size - 1)) - 1);
	}

	@Override
	public int evaluateUnsigned(final String expression, final int size) {
		return evaluate(expression, 0, (0x100 << size) - 1);
	}

	@Override
	public int evaluateUnknownSign(final String expression, final int size) {
		return evaluate(expression, -(0x100 << (size - 1)), (0x100 << size) - 1);
	}

}
